package com.contact.util.util.filters;

import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.contact.util.util.collections.Utils;

public class SearchCollection {

    private final transient Map<String, SearchType> wildCardMap = Utils.newHashMap();
    private String displayValue;

    protected SearchCollection() {
        super();
    }

    public final Map<String, SearchType> getWildCardMap() {
        return wildCardMap;
    }

    public final String getDisplayValue() {
        return displayValue;
    }

    public final void setDisplayValue(String displayValue) {
        this.displayValue = displayValue;
    }

    public Set<WildCardDataFilter> getFilters() {

        Set<WildCardDataFilter> set = Utils.newLinkedHashSet();

        for (Entry<String, SearchType> et : wildCardMap.entrySet()) {

            WildCardDataFilter wcf = new WildCardDataFilter(et.getKey(), et.getValue());
            wcf.setDisplayValue(displayValue);
            wcf.setFilterValue(displayValue);

            set.add(wcf);
        }

        return set;

    }

}
